It is quite easy to switch the power profile for some specific
purpose, and then forgetting to change it back and experiencing
unexpected performance behavior later.
To help with that, indicate the active power profile in the top
bar if it diverges from the default 'balanced' one.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7440
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3961>
_init() {
super._init();
- this.quickSettingsItems.push(new PowerProfilesToggle());
+ this._indicator = this._addIndicator();
+
+ this._powerProfilesToggle = new PowerProfilesToggle();
+
+ this._powerProfilesToggle.bind_property('icon-name',
+ this._indicator, 'icon-name',
+ GObject.BindingFlags.SYNC_CREATE);
+ this._powerProfilesToggle.bind_property('checked',
+ this._indicator, 'visible',
+ GObject.BindingFlags.SYNC_CREATE);
+
+ this.quickSettingsItems.push(this._powerProfilesToggle);
}
});